package org.example.service.impl;

import org.apache.commons.lang3.StringUtils;
import org.example.client.SpringCloudServiceBClient;
import org.example.exception.model.ResponseResult;
import org.example.service.TestOneService;
import org.example.vo.ScanVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
* @description: TODO
* @author 杨镇宇
* @date 2024/7/29 15:02
* @version 1.0
*/
@Service
public class TestOneServiceImpl implements TestOneService {
    @Resource
    private SpringCloudServiceBClient client;


    @Override
    public ResponseResult scan(String path) {

        ScanVo  v1 = ScanVo.builder().path(path).build();
        String scan = client.scan(v1);
        if (StringUtils.isNotBlank(scan)){
            return ResponseResult.ok(scan);
        }
        return null;
    }
}
